<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.js"></script>
</head>
<body>
    <div id="app"></div>
</body>
<script>
    const app = Vue.createApp({
        data(){
            return{
                daat:1111
            }
        },
        methods:{

        },
        // 插槽的使用
        template:`<zujian>
            <template v-slot:one><div style="color:red;">hello world-----{{daat}}</div></template>
            <template v-slot:two><div style="color:red;">hello world-----two</div></template>
            <zujian1/>
            </zujian>`
    })
    app.component("zujian",{
        data(){
            return{
                daat:000
            }
        },
        // 插槽默认值直接写入就可以
        template:`
            <div>你好
                <div>
                    <slot name="one"><div style="color:red;">hello</div></slot>  
                    <div>--------------------------</div>
                    <slot name="two"><div style="color:red;">hello</div></slot>   
                </div>
            </div>
            `
    })
    app.component("zujian1",{
        template:`
            <div>你好不好
            </div>
            `
    })
    app.mount("#app")
</script>
</html>